/*
 * @Author: guandeshen 295570679@qq.com
 * @Date: 2024-05-19 13:24:16
 * @LastEditors: guandeshen 295570679@qq.com
 * @LastEditTime: 2024-05-19 16:46:21
 * @FilePath: /vue3-element-admin/src/api/dashboard/index.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import request from "@/utils/request";
import {
  Nums,
  TaskList,
  DashboardQuery,
  ProjectQuery,
  ProjectList,
  SiteQuery,
  SiteList,
} from "./model";

class DashboardAPI {
  /**
   * 获取任务分页列表
   *
   * @data data
   */
  static getPage(data: DashboardQuery) {
    return request<any, DashboardPageResult<TaskList[], Nums>>({
      url: "/tenant/index/dashboard",
      method: "post",
      data: data,
    });
  }

  /**
   * 筛选项目列表
   *
   * @data data
   */
  static getProject(data: ProjectQuery) {
    return request<any, PageResult<ProjectList[]>>({
      url: "/tenant/project/select",
      method: "post",
      data: data,
    });
  }

  /**
   * 筛选工地列表
   *
   * @data data
   */
  static getSite(data: SiteQuery) {
    return request<any, PageResult<SiteList[]>>({
      url: "/tenant/sites/select",
      method: "post",
      data: data,
    });
  }
}

export default DashboardAPI;
